package com.tanhua.model.vo;

import com.tanhua.model.db.UserInfo;
import com.tanhua.model.mongo.Peachblossom;
import com.tanhua.model.mongo.Visitors;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.swing.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PeachblossomVo {
    private Integer id;//被拾取用户Id
    private String avatar;//被拾取用户头像
    private String nickname;//被拾取用户昵称
    private String gender;//性别
    private Integer age;//年龄
    private String soundUrl;//语音储存地址
    private Integer remainingTimes;//当日剩余查询次数

    public static PeachblossomVo init(UserInfo info, Peachblossom item) {
        PeachblossomVo vo=new PeachblossomVo();
        BeanUtils.copyProperties(info,vo);
        BeanUtils.copyProperties(item,vo);
        Integer id=info.getId().intValue();
        vo.setId(id);
        return vo;
    }
}
